<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <script th:src="@{/layui/layui.js}"></script>
</head>
<body style="height: 100%">
<table id="addressTable" lay-filter="addressTable"></table>
<script type="text/javascript" th:inline="none">
    layui.use(['table','jquery'], function () {
        var table = layui.table,
            $ = layui.$;
        table.render({
            id: 'addressTable'
            , elem: '#addressTable'
            , url: '/address/'+$(parent.document).find('#usid').val()
            , title: '用户数据表'
            , method: 'get'
            , cols: [[
                {field:'area', title: '地址',width:250}
                ,{field:'contacts', title: '联系人',width:80}
                ,{field:'phoneNum',title: '手机号', width:130}
                ,{field:'remark', title: '备注',width:100}
            ]]
            , response: {
                statusCode: 200
            }
            , parseData: function (res) {
                return {
                    "code": res.code,
                    "msg": res.msg,
                    "data": res.data
                };
            }
        });
        table.on('row(addressTable)', function(obj){
            if(parent.addressStatus==1){
                $(parent.document).find("#sendAddress").val(obj.data.area);
                $(parent.document).find("#sendName").val(obj.data.contacts);
                $(parent.document).find("#sendPhone").val(obj.data.phoneNum);
            }else {
                $(parent.document).find("#recAddress").val(obj.data.area);
                $(parent.document).find("#recName").val(obj.data.contacts);
                $(parent.document).find("#recPhone").val(obj.data.phoneNum);
            }
        });
    })
</script>
</body>
</html>